﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Perceiveit.Xml.Converters
{
    #region public class ShortXConverter : XConverter<short>

    public class ShortXConverter : XConverter<short>
    {
        public override short FromString(string value)
        {
            short v;
            if (string.IsNullOrEmpty(value) || !short.TryParse(value, out v))
                v = 0;

            return v;
        }

        public override string ToString(short value)
        {
            return value.ToString();
        }
    }

    #endregion
}
